const app = getApp();
const config = app.require("config/config.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    pageBg: config.style.pageBg,
    loading: false,
    directions: [{
      name: "X轴",
      value: "row"
    }, {
      name: "Y轴",
      value: "column"
    }],
    layouts: {
      one: ["left", "right", "centerX"],
      two: ["top", "bottom", "centerY"],
      thr: ["centerXY"],
      four: ["between"],
      five: ["wrap"],
    },
    xlayout: "",
    ylayout: "",
    direction: "row",
    between: '',
    wrap: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  directionChange: function (e) {
    this.setData({
      direction: e.detail.value
    })
  },
  xlayoutChange: function (e) {
    this.setData({
      xlayout: e.detail.value
    })
  },
  ylayoutChange: function (e) {
    this.setData({
      ylayout: e.detail.value
    })
  },
  xylayoutChange: function (e) {
    this.setData({
      xlayout: e.detail.value,
      ylayout: ""
    })
  },
  blayoutChange: function (e) {
    this.setData({
      between: e.detail.value
    })
  },
  wlayoutChange: function (e) {
    this.setData({
      wrap: e.detail.value
    })
  }
})